{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 4: Selecting Subsets of Data\n",
    "## Recipes\n",
    "* [Selecting Series data](#Selecting-Series-data)\n",
    "* [Selecting DataFrame rows](#Selecting-DataFrame-rows)\n",
    "* [Selecting DataFrame rows and columns simultaneously](#Selecting-DataFrame-rows-and-columns-simultaneously)\n",
    "* [Selecting data with both integers and labels](#Selecting-data-with-both-integers-and-labels)\n",
    "* [Speeding up scalar selection](#Speeding-up-scalar-selection)\n",
    "* [Slicing rows lazily](#Slicing-rows-lazily)\n",
    "* [Slicing lexicographically](#Slicing-Lexicographically)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Selecting Series data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Alabama A & M University                   Normal\n",
       "University of Alabama at Birmingham    Birmingham\n",
       "Amridge University                     Montgomery\n",
       "University of Alabama in Huntsville    Huntsville\n",
       "Alabama State University               Montgomery\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college = pd.read_csv('data/college.csv', index_col='INSTNM')\n",
    "city = college['CITY']\n",
    "city.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Huntsville'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.iloc[3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Birmingham Southern College                            Birmingham\n",
       "George C Wallace State Community College-Hanceville    Hanceville\n",
       "Judson College                                             Marion\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.iloc[[10,20,30]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Alabama State University              Montgomery\n",
       "Enterprise State Community College    Enterprise\n",
       "Heritage Christian University           Florence\n",
       "Marion Military Institute                 Marion\n",
       "Reid State Technical College           Evergreen\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.iloc[4:50:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Florence'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.loc['Heritage Christian University']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Northwest HVAC/R Training Center',\n",
       " 'California State University-Dominguez Hills',\n",
       " 'Lower Columbia College',\n",
       " 'Southwest Acupuncture College-Boulder']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.seed(1)\n",
    "labels = list(np.random.choice(city.index, 4))\n",
    "labels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Northwest HVAC/R Training Center                Spokane\n",
       "California State University-Dominguez Hills      Carson\n",
       "Lower Columbia College                         Longview\n",
       "Southwest Acupuncture College-Boulder           Boulder\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.loc[labels]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Alabama State University              Montgomery\n",
       "Enterprise State Community College    Enterprise\n",
       "Heritage Christian University           Florence\n",
       "Marion Military Institute                 Marion\n",
       "Reid State Technical College           Evergreen\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.loc['Alabama State University':'Reid State Technical College':10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Alabama State University              Montgomery\n",
       "Enterprise State Community College    Enterprise\n",
       "Heritage Christian University           Florence\n",
       "Marion Military Institute                 Marion\n",
       "Reid State Technical College           Evergreen\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city['Alabama State University':'Reid State Technical College':10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## There's more..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "University of Alabama in Huntsville    Huntsville\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.iloc[[3]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Series([], Name: CITY, dtype: object)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.loc['Reid State Technical College':'Alabama State University':10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Reid State Technical College           Evergreen\n",
       "Marion Military Institute                 Marion\n",
       "Heritage Christian University           Florence\n",
       "Enterprise State Community College    Enterprise\n",
       "Alabama State University              Montgomery\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city.loc['Reid State Technical College':'Alabama State University':-10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Selecting DataFrame rows"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Alabama A &amp; M University</th>\n",
       "      <td>Normal</td>\n",
       "      <td>AL</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>424.0</td>\n",
       "      <td>420.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4206.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0059</td>\n",
       "      <td>0.0138</td>\n",
       "      <td>0.0656</td>\n",
       "      <td>1</td>\n",
       "      <td>0.7356</td>\n",
       "      <td>0.8284</td>\n",
       "      <td>0.1049</td>\n",
       "      <td>30300</td>\n",
       "      <td>33888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama at Birmingham</th>\n",
       "      <td>Birmingham</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>570.0</td>\n",
       "      <td>565.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>11383.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0368</td>\n",
       "      <td>0.0179</td>\n",
       "      <td>0.0100</td>\n",
       "      <td>0.2607</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3460</td>\n",
       "      <td>0.5214</td>\n",
       "      <td>0.2422</td>\n",
       "      <td>39700</td>\n",
       "      <td>21941.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Amridge University</th>\n",
       "      <td>Montgomery</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>291.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.2715</td>\n",
       "      <td>0.4536</td>\n",
       "      <td>1</td>\n",
       "      <td>0.6801</td>\n",
       "      <td>0.7795</td>\n",
       "      <td>0.8540</td>\n",
       "      <td>40100</td>\n",
       "      <td>23370</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama in Huntsville</th>\n",
       "      <td>Huntsville</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>595.0</td>\n",
       "      <td>590.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5451.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0172</td>\n",
       "      <td>0.0332</td>\n",
       "      <td>0.0350</td>\n",
       "      <td>0.2146</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3072</td>\n",
       "      <td>0.4596</td>\n",
       "      <td>0.2640</td>\n",
       "      <td>45500</td>\n",
       "      <td>24097</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alabama State University</th>\n",
       "      <td>Montgomery</td>\n",
       "      <td>AL</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>425.0</td>\n",
       "      <td>430.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4811.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0098</td>\n",
       "      <td>0.0243</td>\n",
       "      <td>0.0137</td>\n",
       "      <td>0.0892</td>\n",
       "      <td>1</td>\n",
       "      <td>0.7347</td>\n",
       "      <td>0.7554</td>\n",
       "      <td>0.1270</td>\n",
       "      <td>26600</td>\n",
       "      <td>33118.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                           CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                  \n",
       "Alabama A & M University                 Normal     AL   1.0      0.0   \n",
       "University of Alabama at Birmingham  Birmingham     AL   0.0      0.0   \n",
       "Amridge University                   Montgomery     AL   0.0      0.0   \n",
       "University of Alabama in Huntsville  Huntsville     AL   0.0      0.0   \n",
       "Alabama State University             Montgomery     AL   1.0      0.0   \n",
       "\n",
       "                                     WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  \\\n",
       "INSTNM                                                                         \n",
       "Alabama A & M University                   0.0         0     424.0     420.0   \n",
       "University of Alabama at Birmingham        0.0         0     570.0     565.0   \n",
       "Amridge University                         0.0         1       NaN       NaN   \n",
       "University of Alabama in Huntsville        0.0         0     595.0     590.0   \n",
       "Alabama State University                   0.0         0     425.0     430.0   \n",
       "\n",
       "                                     DISTANCEONLY     UGDS  \\\n",
       "INSTNM                                                       \n",
       "Alabama A & M University                      0.0   4206.0   \n",
       "University of Alabama at Birmingham           0.0  11383.0   \n",
       "Amridge University                            1.0    291.0   \n",
       "University of Alabama in Huntsville           0.0   5451.0   \n",
       "Alabama State University                      0.0   4811.0   \n",
       "\n",
       "                                            ...          UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                      ...                                \n",
       "Alabama A & M University                    ...             0.0000    0.0059   \n",
       "University of Alabama at Birmingham         ...             0.0368    0.0179   \n",
       "Amridge University                          ...             0.0000    0.0000   \n",
       "University of Alabama in Huntsville         ...             0.0172    0.0332   \n",
       "Alabama State University                    ...             0.0098    0.0243   \n",
       "\n",
       "                                     UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                        \n",
       "Alabama A & M University                0.0138    0.0656         1   0.7356   \n",
       "University of Alabama at Birmingham     0.0100    0.2607         1   0.3460   \n",
       "Amridge University                      0.2715    0.4536         1   0.6801   \n",
       "University of Alabama in Huntsville     0.0350    0.2146         1   0.3072   \n",
       "Alabama State University                0.0137    0.0892         1   0.7347   \n",
       "\n",
       "                                     PCTFLOAN  UG25ABV  MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                    \n",
       "Alabama A & M University               0.8284   0.1049            30300   \n",
       "University of Alabama at Birmingham    0.5214   0.2422            39700   \n",
       "Amridge University                     0.7795   0.8540            40100   \n",
       "University of Alabama in Huntsville    0.4596   0.2640            45500   \n",
       "Alabama State University               0.7554   0.1270            26600   \n",
       "\n",
       "                                     GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                   \n",
       "Alabama A & M University                          33888  \n",
       "University of Alabama at Birmingham             21941.5  \n",
       "Amridge University                                23370  \n",
       "University of Alabama in Huntsville               24097  \n",
       "Alabama State University                        33118.5  \n",
       "\n",
       "[5 rows x 26 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college = pd.read_csv('data/college.csv', index_col='INSTNM')\n",
    "college.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "pd.options.display.max_rows = 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "CITY                  Anchorage\n",
       "STABBR                       AK\n",
       "HBCU                          0\n",
       "                        ...    \n",
       "UG25ABV                  0.4386\n",
       "MD_EARN_WNE_P10           42500\n",
       "GRAD_DEBT_MDN_SUPP      19449.5\n",
       "Name: University of Alaska Anchorage, Length: 26, dtype: object"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[60]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "CITY                  Anchorage\n",
       "STABBR                       AK\n",
       "HBCU                          0\n",
       "                        ...    \n",
       "UG25ABV                  0.4386\n",
       "MD_EARN_WNE_P10           42500\n",
       "GRAD_DEBT_MDN_SUPP      19449.5\n",
       "Name: University of Alaska Anchorage, Length: 26, dtype: object"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc['University of Alaska Anchorage']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>University of Alaska Anchorage</th>\n",
       "      <td>Anchorage</td>\n",
       "      <td>AK</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12865.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0980</td>\n",
       "      <td>0.0181</td>\n",
       "      <td>0.0457</td>\n",
       "      <td>0.4539</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2385</td>\n",
       "      <td>0.2647</td>\n",
       "      <td>0.4386</td>\n",
       "      <td>42500</td>\n",
       "      <td>19449.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>International Academy of Hair Design</th>\n",
       "      <td>Tempe</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>188.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0160</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0638</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.7185</td>\n",
       "      <td>0.7346</td>\n",
       "      <td>0.3905</td>\n",
       "      <td>22200</td>\n",
       "      <td>10556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama in Huntsville</th>\n",
       "      <td>Huntsville</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>595.0</td>\n",
       "      <td>590.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5451.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0172</td>\n",
       "      <td>0.0332</td>\n",
       "      <td>0.0350</td>\n",
       "      <td>0.2146</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3072</td>\n",
       "      <td>0.4596</td>\n",
       "      <td>0.2640</td>\n",
       "      <td>45500</td>\n",
       "      <td>24097</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                   \n",
       "University of Alaska Anchorage         Anchorage     AK   0.0      0.0   \n",
       "International Academy of Hair Design       Tempe     AZ   0.0      0.0   \n",
       "University of Alabama in Huntsville   Huntsville     AL   0.0      0.0   \n",
       "\n",
       "                                      WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  \\\n",
       "INSTNM                                                                          \n",
       "University of Alaska Anchorage              0.0         0       NaN       NaN   \n",
       "International Academy of Hair Design        0.0         0       NaN       NaN   \n",
       "University of Alabama in Huntsville         0.0         0     595.0     590.0   \n",
       "\n",
       "                                      DISTANCEONLY     UGDS  \\\n",
       "INSTNM                                                        \n",
       "University of Alaska Anchorage                 0.0  12865.0   \n",
       "International Academy of Hair Design           0.0    188.0   \n",
       "University of Alabama in Huntsville            0.0   5451.0   \n",
       "\n",
       "                                             ...          UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                       ...                                \n",
       "University of Alaska Anchorage               ...             0.0980    0.0181   \n",
       "International Academy of Hair Design         ...             0.0160    0.0000   \n",
       "University of Alabama in Huntsville          ...             0.0172    0.0332   \n",
       "\n",
       "                                      UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                         \n",
       "University of Alaska Anchorage           0.0457    0.4539         1   0.2385   \n",
       "International Academy of Hair Design     0.0638    0.0000         0   0.7185   \n",
       "University of Alabama in Huntsville      0.0350    0.2146         1   0.3072   \n",
       "\n",
       "                                      PCTFLOAN  UG25ABV  MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                     \n",
       "University of Alaska Anchorage          0.2647   0.4386            42500   \n",
       "International Academy of Hair Design    0.7346   0.3905            22200   \n",
       "University of Alabama in Huntsville     0.4596   0.2640            45500   \n",
       "\n",
       "                                      GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                    \n",
       "University of Alaska Anchorage                   19449.5  \n",
       "International Academy of Hair Design               10556  \n",
       "University of Alabama in Huntsville                24097  \n",
       "\n",
       "[3 rows x 26 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[[60, 99, 3]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>University of Alaska Anchorage</th>\n",
       "      <td>Anchorage</td>\n",
       "      <td>AK</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12865.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0980</td>\n",
       "      <td>0.0181</td>\n",
       "      <td>0.0457</td>\n",
       "      <td>0.4539</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2385</td>\n",
       "      <td>0.2647</td>\n",
       "      <td>0.4386</td>\n",
       "      <td>42500</td>\n",
       "      <td>19449.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>International Academy of Hair Design</th>\n",
       "      <td>Tempe</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>188.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0160</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0638</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.7185</td>\n",
       "      <td>0.7346</td>\n",
       "      <td>0.3905</td>\n",
       "      <td>22200</td>\n",
       "      <td>10556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama in Huntsville</th>\n",
       "      <td>Huntsville</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>595.0</td>\n",
       "      <td>590.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5451.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0172</td>\n",
       "      <td>0.0332</td>\n",
       "      <td>0.0350</td>\n",
       "      <td>0.2146</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3072</td>\n",
       "      <td>0.4596</td>\n",
       "      <td>0.2640</td>\n",
       "      <td>45500</td>\n",
       "      <td>24097</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                   \n",
       "University of Alaska Anchorage         Anchorage     AK   0.0      0.0   \n",
       "International Academy of Hair Design       Tempe     AZ   0.0      0.0   \n",
       "University of Alabama in Huntsville   Huntsville     AL   0.0      0.0   \n",
       "\n",
       "                                      WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  \\\n",
       "INSTNM                                                                          \n",
       "University of Alaska Anchorage              0.0         0       NaN       NaN   \n",
       "International Academy of Hair Design        0.0         0       NaN       NaN   \n",
       "University of Alabama in Huntsville         0.0         0     595.0     590.0   \n",
       "\n",
       "                                      DISTANCEONLY     UGDS  \\\n",
       "INSTNM                                                        \n",
       "University of Alaska Anchorage                 0.0  12865.0   \n",
       "International Academy of Hair Design           0.0    188.0   \n",
       "University of Alabama in Huntsville            0.0   5451.0   \n",
       "\n",
       "                                             ...          UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                       ...                                \n",
       "University of Alaska Anchorage               ...             0.0980    0.0181   \n",
       "International Academy of Hair Design         ...             0.0160    0.0000   \n",
       "University of Alabama in Huntsville          ...             0.0172    0.0332   \n",
       "\n",
       "                                      UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                         \n",
       "University of Alaska Anchorage           0.0457    0.4539         1   0.2385   \n",
       "International Academy of Hair Design     0.0638    0.0000         0   0.7185   \n",
       "University of Alabama in Huntsville      0.0350    0.2146         1   0.3072   \n",
       "\n",
       "                                      PCTFLOAN  UG25ABV  MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                     \n",
       "University of Alaska Anchorage          0.2647   0.4386            42500   \n",
       "International Academy of Hair Design    0.7346   0.3905            22200   \n",
       "University of Alabama in Huntsville     0.4596   0.2640            45500   \n",
       "\n",
       "                                      GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                    \n",
       "University of Alaska Anchorage                   19449.5  \n",
       "International Academy of Hair Design               10556  \n",
       "University of Alabama in Huntsville                24097  \n",
       "\n",
       "[3 rows x 26 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "labels = ['University of Alaska Anchorage',\n",
    "          'International Academy of Hair Design',\n",
    "          'University of Alabama in Huntsville']\n",
    "college.loc[labels]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>International Academy of Hair Design</th>\n",
       "      <td>Tempe</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>188.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0160</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0638</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.7185</td>\n",
       "      <td>0.7346</td>\n",
       "      <td>0.3905</td>\n",
       "      <td>22200</td>\n",
       "      <td>10556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>GateWay Community College</th>\n",
       "      <td>Phoenix</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5211.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0127</td>\n",
       "      <td>0.0161</td>\n",
       "      <td>0.0702</td>\n",
       "      <td>0.7465</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3270</td>\n",
       "      <td>0.2189</td>\n",
       "      <td>0.5832</td>\n",
       "      <td>29800</td>\n",
       "      <td>7283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mesa Community College</th>\n",
       "      <td>Mesa</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>19055.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0205</td>\n",
       "      <td>0.0257</td>\n",
       "      <td>0.0682</td>\n",
       "      <td>0.6457</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3423</td>\n",
       "      <td>0.2207</td>\n",
       "      <td>0.4010</td>\n",
       "      <td>35200</td>\n",
       "      <td>8000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                         CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                \n",
       "International Academy of Hair Design    Tempe     AZ   0.0      0.0   \n",
       "GateWay Community College             Phoenix     AZ   0.0      0.0   \n",
       "Mesa Community College                   Mesa     AZ   0.0      0.0   \n",
       "\n",
       "                                      WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  \\\n",
       "INSTNM                                                                          \n",
       "International Academy of Hair Design        0.0         0       NaN       NaN   \n",
       "GateWay Community College                   0.0         0       NaN       NaN   \n",
       "Mesa Community College                      0.0         0       NaN       NaN   \n",
       "\n",
       "                                      DISTANCEONLY     UGDS  \\\n",
       "INSTNM                                                        \n",
       "International Academy of Hair Design           0.0    188.0   \n",
       "GateWay Community College                      0.0   5211.0   \n",
       "Mesa Community College                         0.0  19055.0   \n",
       "\n",
       "                                             ...          UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                       ...                                \n",
       "International Academy of Hair Design         ...             0.0160    0.0000   \n",
       "GateWay Community College                    ...             0.0127    0.0161   \n",
       "Mesa Community College                       ...             0.0205    0.0257   \n",
       "\n",
       "                                      UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                         \n",
       "International Academy of Hair Design     0.0638    0.0000         0   0.7185   \n",
       "GateWay Community College                0.0702    0.7465         1   0.3270   \n",
       "Mesa Community College                   0.0682    0.6457         1   0.3423   \n",
       "\n",
       "                                      PCTFLOAN  UG25ABV  MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                     \n",
       "International Academy of Hair Design    0.7346   0.3905            22200   \n",
       "GateWay Community College               0.2189   0.5832            29800   \n",
       "Mesa Community College                  0.2207   0.4010            35200   \n",
       "\n",
       "                                      GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                    \n",
       "International Academy of Hair Design               10556  \n",
       "GateWay Community College                           7283  \n",
       "Mesa Community College                              8000  \n",
       "\n",
       "[3 rows x 26 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[99:102]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>International Academy of Hair Design</th>\n",
       "      <td>Tempe</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>188.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0160</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0638</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.7185</td>\n",
       "      <td>0.7346</td>\n",
       "      <td>0.3905</td>\n",
       "      <td>22200</td>\n",
       "      <td>10556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>GateWay Community College</th>\n",
       "      <td>Phoenix</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5211.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0127</td>\n",
       "      <td>0.0161</td>\n",
       "      <td>0.0702</td>\n",
       "      <td>0.7465</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3270</td>\n",
       "      <td>0.2189</td>\n",
       "      <td>0.5832</td>\n",
       "      <td>29800</td>\n",
       "      <td>7283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mesa Community College</th>\n",
       "      <td>Mesa</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>19055.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0205</td>\n",
       "      <td>0.0257</td>\n",
       "      <td>0.0682</td>\n",
       "      <td>0.6457</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3423</td>\n",
       "      <td>0.2207</td>\n",
       "      <td>0.4010</td>\n",
       "      <td>35200</td>\n",
       "      <td>8000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                         CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                \n",
       "International Academy of Hair Design    Tempe     AZ   0.0      0.0   \n",
       "GateWay Community College             Phoenix     AZ   0.0      0.0   \n",
       "Mesa Community College                   Mesa     AZ   0.0      0.0   \n",
       "\n",
       "                                      WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  \\\n",
       "INSTNM                                                                          \n",
       "International Academy of Hair Design        0.0         0       NaN       NaN   \n",
       "GateWay Community College                   0.0         0       NaN       NaN   \n",
       "Mesa Community College                      0.0         0       NaN       NaN   \n",
       "\n",
       "                                      DISTANCEONLY     UGDS  \\\n",
       "INSTNM                                                        \n",
       "International Academy of Hair Design           0.0    188.0   \n",
       "GateWay Community College                      0.0   5211.0   \n",
       "Mesa Community College                         0.0  19055.0   \n",
       "\n",
       "                                             ...          UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                       ...                                \n",
       "International Academy of Hair Design         ...             0.0160    0.0000   \n",
       "GateWay Community College                    ...             0.0127    0.0161   \n",
       "Mesa Community College                       ...             0.0205    0.0257   \n",
       "\n",
       "                                      UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                         \n",
       "International Academy of Hair Design     0.0638    0.0000         0   0.7185   \n",
       "GateWay Community College                0.0702    0.7465         1   0.3270   \n",
       "Mesa Community College                   0.0682    0.6457         1   0.3423   \n",
       "\n",
       "                                      PCTFLOAN  UG25ABV  MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                     \n",
       "International Academy of Hair Design    0.7346   0.3905            22200   \n",
       "GateWay Community College               0.2189   0.5832            29800   \n",
       "Mesa Community College                  0.2207   0.4010            35200   \n",
       "\n",
       "                                      GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                    \n",
       "International Academy of Hair Design               10556  \n",
       "GateWay Community College                           7283  \n",
       "Mesa Community College                              8000  \n",
       "\n",
       "[3 rows x 26 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "start = 'International Academy of Hair Design'\n",
    "stop = 'Mesa Community College'\n",
    "college.loc[start:stop]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# There's more..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['University of Alaska Anchorage',\n",
       " 'International Academy of Hair Design',\n",
       " 'University of Alabama in Huntsville']"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[[60, 99, 3]].index.tolist()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Selecting DataFrame rows and columns simultaneously"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Alabama A &amp; M University</th>\n",
       "      <td>Normal</td>\n",
       "      <td>AL</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama at Birmingham</th>\n",
       "      <td>Birmingham</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Amridge University</th>\n",
       "      <td>Montgomery</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                           CITY STABBR  HBCU  MENONLY\n",
       "INSTNM                                                               \n",
       "Alabama A & M University                 Normal     AL   1.0      0.0\n",
       "University of Alabama at Birmingham  Birmingham     AL   0.0      0.0\n",
       "Amridge University                   Montgomery     AL   0.0      0.0"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college = pd.read_csv('data/college.csv', index_col='INSTNM')\n",
    "college.iloc[:3, :4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Alabama A &amp; M University</th>\n",
       "      <td>Normal</td>\n",
       "      <td>AL</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama at Birmingham</th>\n",
       "      <td>Birmingham</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Amridge University</th>\n",
       "      <td>Montgomery</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                           CITY STABBR  HBCU  MENONLY\n",
       "INSTNM                                                               \n",
       "Alabama A & M University                 Normal     AL   1.0      0.0\n",
       "University of Alabama at Birmingham  Birmingham     AL   0.0      0.0\n",
       "Amridge University                   Montgomery     AL   0.0      0.0"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc[:'Amridge University', :'MENONLY']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>SATVRMID</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Alabama A &amp; M University</th>\n",
       "      <td>0.0</td>\n",
       "      <td>424.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama at Birmingham</th>\n",
       "      <td>0.0</td>\n",
       "      <td>570.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Amridge University</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama in Huntsville</th>\n",
       "      <td>0.0</td>\n",
       "      <td>595.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alabama State University</th>\n",
       "      <td>0.0</td>\n",
       "      <td>425.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     WOMENONLY  SATVRMID\n",
       "INSTNM                                                  \n",
       "Alabama A & M University                   0.0     424.0\n",
       "University of Alabama at Birmingham        0.0     570.0\n",
       "Amridge University                         0.0       NaN\n",
       "University of Alabama in Huntsville        0.0     595.0\n",
       "Alabama State University                   0.0     425.0"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[:, [4,6]].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>SATVRMID</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Alabama A &amp; M University</th>\n",
       "      <td>0.0</td>\n",
       "      <td>424.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama at Birmingham</th>\n",
       "      <td>0.0</td>\n",
       "      <td>570.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Amridge University</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>National Personal Training Institute of Cleveland</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bay Area Medical Academy - San Jose Satellite Location</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Excel Learning Center-San Antonio South</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7535 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                    WOMENONLY  SATVRMID\n",
       "INSTNM                                                                 \n",
       "Alabama A & M University                                  0.0     424.0\n",
       "University of Alabama at Birmingham                       0.0     570.0\n",
       "Amridge University                                        0.0       NaN\n",
       "...                                                       ...       ...\n",
       "National Personal Training Institute of Cleveland         NaN       NaN\n",
       "Bay Area Medical Academy - San Jose Satellite L...        NaN       NaN\n",
       "Excel Learning Center-San Antonio South                   NaN       NaN\n",
       "\n",
       "[7535 rows x 2 columns]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc[:, ['WOMENONLY', 'SATVRMID']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>GateWay Community College</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0029</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>American Baptist Seminary of the West</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                       SATMTMID  UGDS_NHPI\n",
       "INSTNM                                                    \n",
       "GateWay Community College                   NaN     0.0029\n",
       "American Baptist Seminary of the West       NaN        NaN"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[[100, 200], [7, 15]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>GateWay Community College</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0029</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>American Baptist Seminary of the West</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                       SATMTMID  UGDS_NHPI\n",
       "INSTNM                                                    \n",
       "GateWay Community College                   NaN     0.0029\n",
       "American Baptist Seminary of the West       NaN        NaN"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rows = ['GateWay Community College', 'American Baptist Seminary of the West']\n",
    "columns = ['SATMTMID', 'UGDS_NHPI']\n",
    "college.loc[rows, columns]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.40100000000000002"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[5, -4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.40100000000000002"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc['The University of Alabama', 'PCTFLOAN']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Empire Beauty School-Flagstaff     0\n",
       "Charles of Italy Beauty College    0\n",
       "Central Arizona College            0\n",
       "University of Arizona              0\n",
       "Arizona State University-Tempe     0\n",
       "Name: RELAFFIL, dtype: int64"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[90:80:-2, 5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Empire Beauty School-Flagstaff     0\n",
       "Charles of Italy Beauty College    0\n",
       "Central Arizona College            0\n",
       "University of Arizona              0\n",
       "Arizona State University-Tempe     0\n",
       "Name: RELAFFIL, dtype: int64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "start = 'Empire Beauty School-Flagstaff'\n",
    "stop = 'Arizona State University-Tempe'\n",
    "college.loc[start:stop:-2, 'RELAFFIL']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Selecting data with both integers and labels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "college = pd.read_csv('data/college.csv', index_col='INSTNM')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10, 19)"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col_start = college.columns.get_loc('UGDS_WHITE')\n",
    "col_end = college.columns.get_loc('UGDS_UNKN') + 1\n",
    "col_start, col_end"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Alabama A &amp; M University</th>\n",
       "      <td>0.0333</td>\n",
       "      <td>0.9353</td>\n",
       "      <td>0.0055</td>\n",
       "      <td>0.0019</td>\n",
       "      <td>0.0024</td>\n",
       "      <td>0.0019</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0059</td>\n",
       "      <td>0.0138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama at Birmingham</th>\n",
       "      <td>0.5922</td>\n",
       "      <td>0.2600</td>\n",
       "      <td>0.0283</td>\n",
       "      <td>0.0518</td>\n",
       "      <td>0.0022</td>\n",
       "      <td>0.0007</td>\n",
       "      <td>0.0368</td>\n",
       "      <td>0.0179</td>\n",
       "      <td>0.0100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Amridge University</th>\n",
       "      <td>0.2990</td>\n",
       "      <td>0.4192</td>\n",
       "      <td>0.0069</td>\n",
       "      <td>0.0034</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.2715</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama in Huntsville</th>\n",
       "      <td>0.6988</td>\n",
       "      <td>0.1255</td>\n",
       "      <td>0.0382</td>\n",
       "      <td>0.0376</td>\n",
       "      <td>0.0143</td>\n",
       "      <td>0.0002</td>\n",
       "      <td>0.0172</td>\n",
       "      <td>0.0332</td>\n",
       "      <td>0.0350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alabama State University</th>\n",
       "      <td>0.0158</td>\n",
       "      <td>0.9208</td>\n",
       "      <td>0.0121</td>\n",
       "      <td>0.0019</td>\n",
       "      <td>0.0010</td>\n",
       "      <td>0.0006</td>\n",
       "      <td>0.0098</td>\n",
       "      <td>0.0243</td>\n",
       "      <td>0.0137</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     UGDS_WHITE  UGDS_BLACK  UGDS_HISP  \\\n",
       "INSTNM                                                                   \n",
       "Alabama A & M University                 0.0333      0.9353     0.0055   \n",
       "University of Alabama at Birmingham      0.5922      0.2600     0.0283   \n",
       "Amridge University                       0.2990      0.4192     0.0069   \n",
       "University of Alabama in Huntsville      0.6988      0.1255     0.0382   \n",
       "Alabama State University                 0.0158      0.9208     0.0121   \n",
       "\n",
       "                                     UGDS_ASIAN  UGDS_AIAN  UGDS_NHPI  \\\n",
       "INSTNM                                                                  \n",
       "Alabama A & M University                 0.0019     0.0024     0.0019   \n",
       "University of Alabama at Birmingham      0.0518     0.0022     0.0007   \n",
       "Amridge University                       0.0034     0.0000     0.0000   \n",
       "University of Alabama in Huntsville      0.0376     0.0143     0.0002   \n",
       "Alabama State University                 0.0019     0.0010     0.0006   \n",
       "\n",
       "                                     UGDS_2MOR  UGDS_NRA  UGDS_UNKN  \n",
       "INSTNM                                                               \n",
       "Alabama A & M University                0.0000    0.0059     0.0138  \n",
       "University of Alabama at Birmingham     0.0368    0.0179     0.0100  \n",
       "Amridge University                      0.0000    0.0000     0.2715  \n",
       "University of Alabama in Huntsville     0.0172    0.0332     0.0350  \n",
       "Alabama State University                0.0098    0.0243     0.0137  "
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.iloc[:5, col_start:col_end]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# There's more..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Birmingham Southern College</th>\n",
       "      <td>0.7983</td>\n",
       "      <td>0.1102</td>\n",
       "      <td>0.0195</td>\n",
       "      <td>0.0517</td>\n",
       "      <td>0.0102</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0051</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Chattahoochee Valley Community College</th>\n",
       "      <td>0.4661</td>\n",
       "      <td>0.4372</td>\n",
       "      <td>0.0492</td>\n",
       "      <td>0.0127</td>\n",
       "      <td>0.0023</td>\n",
       "      <td>0.0035</td>\n",
       "      <td>0.0151</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0139</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Concordia College Alabama</th>\n",
       "      <td>0.0280</td>\n",
       "      <td>0.8758</td>\n",
       "      <td>0.0373</td>\n",
       "      <td>0.0093</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0031</td>\n",
       "      <td>0.0466</td>\n",
       "      <td>0.0000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>South University-Montgomery</th>\n",
       "      <td>0.3046</td>\n",
       "      <td>0.6054</td>\n",
       "      <td>0.0153</td>\n",
       "      <td>0.0153</td>\n",
       "      <td>0.0153</td>\n",
       "      <td>0.0096</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0019</td>\n",
       "      <td>0.0326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Enterprise State Community College</th>\n",
       "      <td>0.6408</td>\n",
       "      <td>0.2435</td>\n",
       "      <td>0.0509</td>\n",
       "      <td>0.0202</td>\n",
       "      <td>0.0081</td>\n",
       "      <td>0.0029</td>\n",
       "      <td>0.0254</td>\n",
       "      <td>0.0012</td>\n",
       "      <td>0.0069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James H Faulkner State Community College</th>\n",
       "      <td>0.6979</td>\n",
       "      <td>0.2259</td>\n",
       "      <td>0.0320</td>\n",
       "      <td>0.0084</td>\n",
       "      <td>0.0177</td>\n",
       "      <td>0.0014</td>\n",
       "      <td>0.0152</td>\n",
       "      <td>0.0007</td>\n",
       "      <td>0.0009</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          UGDS_WHITE  UGDS_BLACK  UGDS_HISP  \\\n",
       "INSTNM                                                                        \n",
       "Birmingham Southern College                   0.7983      0.1102     0.0195   \n",
       "Chattahoochee Valley Community College        0.4661      0.4372     0.0492   \n",
       "Concordia College Alabama                     0.0280      0.8758     0.0373   \n",
       "South University-Montgomery                   0.3046      0.6054     0.0153   \n",
       "Enterprise State Community College            0.6408      0.2435     0.0509   \n",
       "James H Faulkner State Community College      0.6979      0.2259     0.0320   \n",
       "\n",
       "                                          UGDS_ASIAN  UGDS_AIAN  UGDS_NHPI  \\\n",
       "INSTNM                                                                       \n",
       "Birmingham Southern College                   0.0517     0.0102     0.0000   \n",
       "Chattahoochee Valley Community College        0.0127     0.0023     0.0035   \n",
       "Concordia College Alabama                     0.0093     0.0000     0.0000   \n",
       "South University-Montgomery                   0.0153     0.0153     0.0096   \n",
       "Enterprise State Community College            0.0202     0.0081     0.0029   \n",
       "James H Faulkner State Community College      0.0084     0.0177     0.0014   \n",
       "\n",
       "                                          UGDS_2MOR  UGDS_NRA  UGDS_UNKN  \n",
       "INSTNM                                                                    \n",
       "Birmingham Southern College                  0.0051    0.0000     0.0051  \n",
       "Chattahoochee Valley Community College       0.0151    0.0000     0.0139  \n",
       "Concordia College Alabama                    0.0031    0.0466     0.0000  \n",
       "South University-Montgomery                  0.0000    0.0019     0.0326  \n",
       "Enterprise State Community College           0.0254    0.0012     0.0069  \n",
       "James H Faulkner State Community College     0.0152    0.0007     0.0009  "
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row_start = college.index[10]\n",
    "row_end = college.index[15]\n",
    "college.loc[row_start:row_end, 'UGDS_WHITE':'UGDS_UNKN']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Speeding up scalar selection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.66099999999999992"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college = pd.read_csv('data/college.csv', index_col='INSTNM')\n",
    "cn = 'Texas A & M University-College Station'\n",
    "college.loc[cn, 'UGDS_WHITE']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.66099999999999992"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.at[cn, 'UGDS_WHITE']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9.93 µs ± 274 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college.loc[cn, 'UGDS_WHITE']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6.69 µs ± 223 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college.at[cn, 'UGDS_WHITE']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "row_num = college.index.get_loc(cn)\n",
    "col_num = college.columns.get_loc('UGDS_WHITE')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3765, 10)"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row_num, col_num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11.1 µs ± 426 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college.iloc[row_num, col_num]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7.47 µs ± 109 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college.iat[row_num, col_num]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10.8 µs ± 467 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college.iloc[5, col_num]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7.12 µs ± 297 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college.iat[5, col_num]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## There's more..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "state = college['STABBR']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'IL'"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "state.iat[1000]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'CA'"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "state.at['Stanford University']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Slicing rows lazily"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Birmingham Southern College</th>\n",
       "      <td>Birmingham</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>560.0</td>\n",
       "      <td>560.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1180.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0051</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0051</td>\n",
       "      <td>0.0017</td>\n",
       "      <td>1</td>\n",
       "      <td>0.1920</td>\n",
       "      <td>0.4809</td>\n",
       "      <td>0.0152</td>\n",
       "      <td>44200</td>\n",
       "      <td>27000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Concordia College Alabama</th>\n",
       "      <td>Selma</td>\n",
       "      <td>AL</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>420.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>322.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0031</td>\n",
       "      <td>0.0466</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.1056</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8667</td>\n",
       "      <td>0.9333</td>\n",
       "      <td>0.2367</td>\n",
       "      <td>19900</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Enterprise State Community College</th>\n",
       "      <td>Enterprise</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1729.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0254</td>\n",
       "      <td>0.0012</td>\n",
       "      <td>0.0069</td>\n",
       "      <td>0.3823</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4895</td>\n",
       "      <td>0.2263</td>\n",
       "      <td>0.3399</td>\n",
       "      <td>24600</td>\n",
       "      <td>8273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Faulkner University</th>\n",
       "      <td>Montgomery</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2367.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0173</td>\n",
       "      <td>0.0182</td>\n",
       "      <td>0.0258</td>\n",
       "      <td>0.2302</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5812</td>\n",
       "      <td>0.7253</td>\n",
       "      <td>0.4589</td>\n",
       "      <td>37200</td>\n",
       "      <td>22000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>New Beginning College of Cosmetology</th>\n",
       "      <td>Albertville</td>\n",
       "      <td>AL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>115.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0783</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8224</td>\n",
       "      <td>0.8553</td>\n",
       "      <td>0.3933</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5500</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                             CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                    \n",
       "Birmingham Southern College            Birmingham     AL   0.0      0.0   \n",
       "Concordia College Alabama                   Selma     AL   1.0      0.0   \n",
       "Enterprise State Community College     Enterprise     AL   0.0      0.0   \n",
       "Faulkner University                    Montgomery     AL   0.0      0.0   \n",
       "New Beginning College of Cosmetology  Albertville     AL   0.0      0.0   \n",
       "\n",
       "                                      WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  \\\n",
       "INSTNM                                                                          \n",
       "Birmingham Southern College                 0.0         1     560.0     560.0   \n",
       "Concordia College Alabama                   0.0         1     420.0     400.0   \n",
       "Enterprise State Community College          0.0         0       NaN       NaN   \n",
       "Faulkner University                         0.0         1       NaN       NaN   \n",
       "New Beginning College of Cosmetology        0.0         0       NaN       NaN   \n",
       "\n",
       "                                      DISTANCEONLY    UGDS  \\\n",
       "INSTNM                                                       \n",
       "Birmingham Southern College                    0.0  1180.0   \n",
       "Concordia College Alabama                      0.0   322.0   \n",
       "Enterprise State Community College             0.0  1729.0   \n",
       "Faulkner University                            0.0  2367.0   \n",
       "New Beginning College of Cosmetology           0.0   115.0   \n",
       "\n",
       "                                             ...          UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                       ...                                \n",
       "Birmingham Southern College                  ...             0.0051    0.0000   \n",
       "Concordia College Alabama                    ...             0.0031    0.0466   \n",
       "Enterprise State Community College           ...             0.0254    0.0012   \n",
       "Faulkner University                          ...             0.0173    0.0182   \n",
       "New Beginning College of Cosmetology         ...             0.0000    0.0000   \n",
       "\n",
       "                                      UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                         \n",
       "Birmingham Southern College              0.0051    0.0017         1   0.1920   \n",
       "Concordia College Alabama                0.0000    0.1056         1   0.8667   \n",
       "Enterprise State Community College       0.0069    0.3823         1   0.4895   \n",
       "Faulkner University                      0.0258    0.2302         1   0.5812   \n",
       "New Beginning College of Cosmetology     0.0000    0.0783         1   0.8224   \n",
       "\n",
       "                                      PCTFLOAN  UG25ABV  MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                     \n",
       "Birmingham Southern College             0.4809   0.0152            44200   \n",
       "Concordia College Alabama               0.9333   0.2367            19900   \n",
       "Enterprise State Community College      0.2263   0.3399            24600   \n",
       "Faulkner University                     0.7253   0.4589            37200   \n",
       "New Beginning College of Cosmetology    0.8553   0.3933              NaN   \n",
       "\n",
       "                                      GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                    \n",
       "Birmingham Southern College                        27000  \n",
       "Concordia College Alabama              PrivacySuppressed  \n",
       "Enterprise State Community College                  8273  \n",
       "Faulkner University                                22000  \n",
       "New Beginning College of Cosmetology                5500  \n",
       "\n",
       "[5 rows x 26 columns]"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college = pd.read_csv('data/college.csv', index_col='INSTNM')\n",
    "college[10:20:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Birmingham Southern College              Birmingham\n",
       "Concordia College Alabama                     Selma\n",
       "Enterprise State Community College       Enterprise\n",
       "Faulkner University                      Montgomery\n",
       "New Beginning College of Cosmetology    Albertville\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city[10:20:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Spokane Community College'"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.index[4001]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Mesa Community College</th>\n",
       "      <td>Mesa</td>\n",
       "      <td>AZ</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>19055.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0205</td>\n",
       "      <td>0.0257</td>\n",
       "      <td>0.0682</td>\n",
       "      <td>0.6457</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3423</td>\n",
       "      <td>0.2207</td>\n",
       "      <td>0.4010</td>\n",
       "      <td>35200</td>\n",
       "      <td>8000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Hair Academy Inc-New Carrollton</th>\n",
       "      <td>New Carrollton</td>\n",
       "      <td>MD</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>504.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.4683</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9756</td>\n",
       "      <td>1.0000</td>\n",
       "      <td>0.5882</td>\n",
       "      <td>15200</td>\n",
       "      <td>9666</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>National College of Natural Medicine</th>\n",
       "      <td>Portland</td>\n",
       "      <td>OR</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                       \n",
       "Mesa Community College                          Mesa     AZ   0.0      0.0   \n",
       "Hair Academy Inc-New Carrollton       New Carrollton     MD   0.0      0.0   \n",
       "National College of Natural Medicine        Portland     OR   0.0      0.0   \n",
       "\n",
       "                                      WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  \\\n",
       "INSTNM                                                                          \n",
       "Mesa Community College                      0.0         0       NaN       NaN   \n",
       "Hair Academy Inc-New Carrollton             0.0         0       NaN       NaN   \n",
       "National College of Natural Medicine        0.0         0       NaN       NaN   \n",
       "\n",
       "                                      DISTANCEONLY     UGDS  \\\n",
       "INSTNM                                                        \n",
       "Mesa Community College                         0.0  19055.0   \n",
       "Hair Academy Inc-New Carrollton                0.0    504.0   \n",
       "National College of Natural Medicine           0.0      NaN   \n",
       "\n",
       "                                             ...          UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                       ...                                \n",
       "Mesa Community College                       ...             0.0205    0.0257   \n",
       "Hair Academy Inc-New Carrollton              ...             0.0000    0.0000   \n",
       "National College of Natural Medicine         ...                NaN       NaN   \n",
       "\n",
       "                                      UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                         \n",
       "Mesa Community College                   0.0682    0.6457         1   0.3423   \n",
       "Hair Academy Inc-New Carrollton          0.0000    0.4683         1   0.9756   \n",
       "National College of Natural Medicine        NaN       NaN         1      NaN   \n",
       "\n",
       "                                      PCTFLOAN  UG25ABV  MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                     \n",
       "Mesa Community College                  0.2207   0.4010            35200   \n",
       "Hair Academy Inc-New Carrollton         1.0000   0.5882            15200   \n",
       "National College of Natural Medicine       NaN      NaN              NaN   \n",
       "\n",
       "                                      GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                    \n",
       "Mesa Community College                              8000  \n",
       "Hair Academy Inc-New Carrollton                     9666  \n",
       "National College of Natural Medicine   PrivacySuppressed  \n",
       "\n",
       "[3 rows x 26 columns]"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "start = 'Mesa Community College'\n",
    "stop = 'Spokane Community College'\n",
    "college[start:stop:1500]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "INSTNM\n",
       "Mesa Community College                            Mesa\n",
       "Hair Academy Inc-New Carrollton         New Carrollton\n",
       "National College of Natural Medicine          Portland\n",
       "Name: CITY, dtype: object"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city[start:stop:1500]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## There's more..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "unhashable type: 'slice'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-55-92538c61bdfa>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mcollege\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m'CITY'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'STABBR'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/frame.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m   1962\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_getitem_multilevel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1963\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1964\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_getitem_column\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1965\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1966\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_getitem_column\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/frame.py\u001b[0m in \u001b[0;36m_getitem_column\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m   1969\u001b[0m         \u001b[0;31m# get column\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1970\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_unique\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1971\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_item_cache\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1972\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1973\u001b[0m         \u001b[0;31m# duplicate columns & possible reduce dimensionality\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36m_get_item_cache\u001b[0;34m(self, item)\u001b[0m\n\u001b[1;32m   1641\u001b[0m         \u001b[0;34m\"\"\"Return the cached item, item represents a label indexer.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1642\u001b[0m         \u001b[0mcache\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_item_cache\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1643\u001b[0;31m         \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1644\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mres\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1645\u001b[0m             \u001b[0mvalues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'slice'"
     ]
    }
   ],
   "source": [
    "college[:10, ['CITY', 'STABBR']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Alabama A &amp; M University</th>\n",
       "      <td>Normal</td>\n",
       "      <td>AL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>University of Alabama at Birmingham</th>\n",
       "      <td>Birmingham</td>\n",
       "      <td>AL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Amridge University</th>\n",
       "      <td>Montgomery</td>\n",
       "      <td>AL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Athens State University</th>\n",
       "      <td>Athens</td>\n",
       "      <td>AL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Auburn University at Montgomery</th>\n",
       "      <td>Montgomery</td>\n",
       "      <td>AL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Auburn University</th>\n",
       "      <td>Auburn</td>\n",
       "      <td>AL</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                           CITY STABBR\n",
       "INSTNM                                                \n",
       "Alabama A & M University                 Normal     AL\n",
       "University of Alabama at Birmingham  Birmingham     AL\n",
       "Amridge University                   Montgomery     AL\n",
       "...                                         ...    ...\n",
       "Athens State University                  Athens     AL\n",
       "Auburn University at Montgomery      Montgomery     AL\n",
       "Auburn University                        Auburn     AL\n",
       "\n",
       "[10 rows x 2 columns]"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_ten_instnm = college.index[:10]\n",
    "college.loc[first_ten_instnm, ['CITY', 'STABBR']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Slicing Lexicographically"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'Sp'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mget_slice_bound\u001b[0;34m(self, label, side, kind)\u001b[0m\n\u001b[1;32m   3483\u001b[0m             \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3484\u001b[0;31m                 \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_searchsorted_monotonic\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mside\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   3485\u001b[0m             \u001b[0;32mexcept\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36m_searchsorted_monotonic\u001b[0;34m(self, label, side)\u001b[0m\n\u001b[1;32m   3442\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3443\u001b[0;31m         \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'index must be monotonic increasing or decreasing'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   3444\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mValueError\u001b[0m: index must be monotonic increasing or decreasing",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[0;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-57-c9f1c69a918b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0mcollege\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'data/college.csv'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindex_col\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'INSTNM'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mcollege\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'Sp'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m'Su'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m   1326\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1327\u001b[0m             \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply_if_callable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1328\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_getitem_axis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1329\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1330\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_is_scalar_access\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py\u001b[0m in \u001b[0;36m_getitem_axis\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m   1504\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mslice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1505\u001b[0m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_has_valid_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1506\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_slice_axis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1507\u001b[0m         \u001b[0;32melif\u001b[0m \u001b[0mis_bool_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1508\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_getbool_axis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py\u001b[0m in \u001b[0;36m_get_slice_axis\u001b[0;34m(self, slice_obj, axis)\u001b[0m\n\u001b[1;32m   1354\u001b[0m         \u001b[0mlabels\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_axis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1355\u001b[0m         indexer = labels.slice_indexer(slice_obj.start, slice_obj.stop,\n\u001b[0;32m-> 1356\u001b[0;31m                                        slice_obj.step, kind=self.name)\n\u001b[0m\u001b[1;32m   1357\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1358\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mindexer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mslice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mslice_indexer\u001b[0;34m(self, start, end, step, kind)\u001b[0m\n\u001b[1;32m   3348\u001b[0m         \"\"\"\n\u001b[1;32m   3349\u001b[0m         start_slice, end_slice = self.slice_locs(start, end, step=step,\n\u001b[0;32m-> 3350\u001b[0;31m                                                  kind=kind)\n\u001b[0m\u001b[1;32m   3351\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3352\u001b[0m         \u001b[0;31m# return a slice\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mslice_locs\u001b[0;34m(self, start, end, step, kind)\u001b[0m\n\u001b[1;32m   3536\u001b[0m         \u001b[0mstart_slice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3537\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mstart\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3538\u001b[0;31m             \u001b[0mstart_slice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_slice_bound\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstart\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'left'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkind\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   3539\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mstart_slice\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3540\u001b[0m             \u001b[0mstart_slice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mget_slice_bound\u001b[0;34m(self, label, side, kind)\u001b[0m\n\u001b[1;32m   3485\u001b[0m             \u001b[0;32mexcept\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3486\u001b[0m                 \u001b[0;31m# raise the original KeyError\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3487\u001b[0;31m                 \u001b[0;32mraise\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   3488\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3489\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mslc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mndarray\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mget_slice_bound\u001b[0;34m(self, label, side, kind)\u001b[0m\n\u001b[1;32m   3479\u001b[0m         \u001b[0;31m# we need to look up the label\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3480\u001b[0m         \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3481\u001b[0;31m             \u001b[0mslc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_loc_only_exact_matches\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlabel\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   3482\u001b[0m         \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3483\u001b[0m             \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36m_get_loc_only_exact_matches\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m   3448\u001b[0m         \u001b[0mget_slice_bound\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3449\u001b[0m         \"\"\"\n\u001b[0;32m-> 3450\u001b[0;31m         \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   3451\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3452\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0mget_slice_bound\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mside\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkind\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/Users/Ted/anaconda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mget_loc\u001b[0;34m(self, key, method, tolerance)\u001b[0m\n\u001b[1;32m   2442\u001b[0m                 \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2443\u001b[0m             \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2444\u001b[0;31m                 \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_maybe_cast_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   2445\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2446\u001b[0m         \u001b[0mindexer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmethod\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmethod\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtolerance\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtolerance\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32mpandas/_libs/index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc (pandas/_libs/index.c:5280)\u001b[0;34m()\u001b[0m\n",
      "\u001b[0;32mpandas/_libs/index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc (pandas/_libs/index.c:5126)\u001b[0;34m()\u001b[0m\n",
      "\u001b[0;32mpandas/_libs/hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item (pandas/_libs/hashtable.c:20523)\u001b[0;34m()\u001b[0m\n",
      "\u001b[0;32mpandas/_libs/hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item (pandas/_libs/hashtable.c:20477)\u001b[0;34m()\u001b[0m\n",
      "\u001b[0;31mKeyError\u001b[0m: 'Sp'"
     ]
    }
   ],
   "source": [
    "college = pd.read_csv('data/college.csv', index_col='INSTNM')\n",
    "college.loc['Sp':'Su']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "college = college.sort_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A &amp; W Healthcare Educators</th>\n",
       "      <td>New Orleans</td>\n",
       "      <td>LA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.1250</td>\n",
       "      <td>1</td>\n",
       "      <td>0.7018</td>\n",
       "      <td>0.8596</td>\n",
       "      <td>0.6667</td>\n",
       "      <td>NaN</td>\n",
       "      <td>19022.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A T Still University of Health Sciences</th>\n",
       "      <td>Kirksville</td>\n",
       "      <td>MO</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>219800</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ABC Beauty Academy</th>\n",
       "      <td>Garland</td>\n",
       "      <td>TX</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0.7857</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.8286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ABC Beauty College Inc</th>\n",
       "      <td>Arkadelphia</td>\n",
       "      <td>AR</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.2105</td>\n",
       "      <td>1</td>\n",
       "      <td>0.9815</td>\n",
       "      <td>1.0000</td>\n",
       "      <td>0.4688</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>16500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AI Miami International University of Art and Design</th>\n",
       "      <td>Miami</td>\n",
       "      <td>FL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2778.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0018</td>\n",
       "      <td>0.0025</td>\n",
       "      <td>0.4644</td>\n",
       "      <td>0.2185</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5507</td>\n",
       "      <td>0.6966</td>\n",
       "      <td>0.3262</td>\n",
       "      <td>29900</td>\n",
       "      <td>31000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                           CITY STABBR  HBCU  \\\n",
       "INSTNM                                                                         \n",
       "A & W Healthcare Educators                          New Orleans     LA   0.0   \n",
       "A T Still University of Health Sciences              Kirksville     MO   0.0   \n",
       "ABC Beauty Academy                                      Garland     TX   0.0   \n",
       "ABC Beauty College Inc                              Arkadelphia     AR   0.0   \n",
       "AI Miami International University of Art and De...        Miami     FL   0.0   \n",
       "\n",
       "                                                    MENONLY  WOMENONLY  \\\n",
       "INSTNM                                                                   \n",
       "A & W Healthcare Educators                              0.0        0.0   \n",
       "A T Still University of Health Sciences                 0.0        0.0   \n",
       "ABC Beauty Academy                                      0.0        0.0   \n",
       "ABC Beauty College Inc                                  0.0        0.0   \n",
       "AI Miami International University of Art and De...      0.0        0.0   \n",
       "\n",
       "                                                    RELAFFIL  SATVRMID  \\\n",
       "INSTNM                                                                   \n",
       "A & W Healthcare Educators                                 0       NaN   \n",
       "A T Still University of Health Sciences                    0       NaN   \n",
       "ABC Beauty Academy                                         0       NaN   \n",
       "ABC Beauty College Inc                                     0       NaN   \n",
       "AI Miami International University of Art and De...         0       NaN   \n",
       "\n",
       "                                                    SATMTMID  DISTANCEONLY  \\\n",
       "INSTNM                                                                       \n",
       "A & W Healthcare Educators                               NaN           0.0   \n",
       "A T Still University of Health Sciences                  NaN           0.0   \n",
       "ABC Beauty Academy                                       NaN           0.0   \n",
       "ABC Beauty College Inc                                   NaN           0.0   \n",
       "AI Miami International University of Art and De...       NaN           0.0   \n",
       "\n",
       "                                                      UGDS  \\\n",
       "INSTNM                                                       \n",
       "A & W Healthcare Educators                            40.0   \n",
       "A T Still University of Health Sciences                NaN   \n",
       "ABC Beauty Academy                                    30.0   \n",
       "ABC Beauty College Inc                                38.0   \n",
       "AI Miami International University of Art and De...  2778.0   \n",
       "\n",
       "                                                           ...          \\\n",
       "INSTNM                                                     ...           \n",
       "A & W Healthcare Educators                                 ...           \n",
       "A T Still University of Health Sciences                    ...           \n",
       "ABC Beauty Academy                                         ...           \n",
       "ABC Beauty College Inc                                     ...           \n",
       "AI Miami International University of Art and De...         ...           \n",
       "\n",
       "                                                    UGDS_2MOR  UGDS_NRA  \\\n",
       "INSTNM                                                                    \n",
       "A & W Healthcare Educators                             0.0000    0.0000   \n",
       "A T Still University of Health Sciences                   NaN       NaN   \n",
       "ABC Beauty Academy                                     0.0000    0.0000   \n",
       "ABC Beauty College Inc                                 0.0000    0.0000   \n",
       "AI Miami International University of Art and De...     0.0018    0.0025   \n",
       "\n",
       "                                                    UGDS_UNKN  PPTUG_EF  \\\n",
       "INSTNM                                                                    \n",
       "A & W Healthcare Educators                             0.0000    0.1250   \n",
       "A T Still University of Health Sciences                   NaN       NaN   \n",
       "ABC Beauty Academy                                     0.0000    0.0000   \n",
       "ABC Beauty College Inc                                 0.0000    0.2105   \n",
       "AI Miami International University of Art and De...     0.4644    0.2185   \n",
       "\n",
       "                                                    CURROPER  PCTPELL  \\\n",
       "INSTNM                                                                  \n",
       "A & W Healthcare Educators                                 1   0.7018   \n",
       "A T Still University of Health Sciences                    1      NaN   \n",
       "ABC Beauty Academy                                         0   0.7857   \n",
       "ABC Beauty College Inc                                     1   0.9815   \n",
       "AI Miami International University of Art and De...         1   0.5507   \n",
       "\n",
       "                                                    PCTFLOAN  UG25ABV  \\\n",
       "INSTNM                                                                  \n",
       "A & W Healthcare Educators                            0.8596   0.6667   \n",
       "A T Still University of Health Sciences                  NaN      NaN   \n",
       "ABC Beauty Academy                                    0.0000   0.8286   \n",
       "ABC Beauty College Inc                                1.0000   0.4688   \n",
       "AI Miami International University of Art and De...    0.6966   0.3262   \n",
       "\n",
       "                                                      MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                  \n",
       "A & W Healthcare Educators                                        NaN   \n",
       "A T Still University of Health Sciences                        219800   \n",
       "ABC Beauty Academy                                                NaN   \n",
       "ABC Beauty College Inc                              PrivacySuppressed   \n",
       "AI Miami International University of Art and De...              29900   \n",
       "\n",
       "                                                    GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                                  \n",
       "A & W Healthcare Educators                                     19022.5  \n",
       "A T Still University of Health Sciences              PrivacySuppressed  \n",
       "ABC Beauty Academy                                   PrivacySuppressed  \n",
       "ABC Beauty College Inc                                           16500  \n",
       "AI Miami International University of Art and De...               31000  \n",
       "\n",
       "[5 rows x 26 columns]"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "pd.options.display.max_rows = 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Spa Tech Institute-Ipswich</th>\n",
       "      <td>Ipswich</td>\n",
       "      <td>MA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0541</td>\n",
       "      <td>0.4054</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2656</td>\n",
       "      <td>0.3906</td>\n",
       "      <td>0.7907</td>\n",
       "      <td>21500</td>\n",
       "      <td>6333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spa Tech Institute-Plymouth</th>\n",
       "      <td>Plymouth</td>\n",
       "      <td>MA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>153.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.2484</td>\n",
       "      <td>0.3399</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3716</td>\n",
       "      <td>0.4266</td>\n",
       "      <td>0.6250</td>\n",
       "      <td>21500</td>\n",
       "      <td>6333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spa Tech Institute-Westboro</th>\n",
       "      <td>Westboro</td>\n",
       "      <td>MA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0222</td>\n",
       "      <td>0.5778</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3409</td>\n",
       "      <td>0.4545</td>\n",
       "      <td>0.6882</td>\n",
       "      <td>21500</td>\n",
       "      <td>6333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Stylemaster College of Hair Design</th>\n",
       "      <td>Longview</td>\n",
       "      <td>WA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.013</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8036</td>\n",
       "      <td>0.7024</td>\n",
       "      <td>0.4510</td>\n",
       "      <td>17000</td>\n",
       "      <td>13320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Styles and Profiles Beauty College</th>\n",
       "      <td>Selmer</td>\n",
       "      <td>TN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8182</td>\n",
       "      <td>0.7955</td>\n",
       "      <td>0.2400</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Styletrends Barber and Hairstyling Academy</th>\n",
       "      <td>Rock Hill</td>\n",
       "      <td>SC</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>45.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.5556</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0000</td>\n",
       "      <td>1.0000</td>\n",
       "      <td>0.3529</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>9495.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>201 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                 CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                        \n",
       "Spa Tech Institute-Ipswich                    Ipswich     MA   0.0      0.0   \n",
       "Spa Tech Institute-Plymouth                  Plymouth     MA   0.0      0.0   \n",
       "Spa Tech Institute-Westboro                  Westboro     MA   0.0      0.0   \n",
       "...                                               ...    ...   ...      ...   \n",
       "Stylemaster College of Hair Design           Longview     WA   0.0      0.0   \n",
       "Styles and Profiles Beauty College             Selmer     TN   0.0      0.0   \n",
       "Styletrends Barber and Hairstyling Academy  Rock Hill     SC   0.0      0.0   \n",
       "\n",
       "                                            WOMENONLY  RELAFFIL  SATVRMID  \\\n",
       "INSTNM                                                                      \n",
       "Spa Tech Institute-Ipswich                        0.0         0       NaN   \n",
       "Spa Tech Institute-Plymouth                       0.0         0       NaN   \n",
       "Spa Tech Institute-Westboro                       0.0         0       NaN   \n",
       "...                                               ...       ...       ...   \n",
       "Stylemaster College of Hair Design                0.0         0       NaN   \n",
       "Styles and Profiles Beauty College                0.0         0       NaN   \n",
       "Styletrends Barber and Hairstyling Academy        0.0         0       NaN   \n",
       "\n",
       "                                            SATMTMID  DISTANCEONLY   UGDS  \\\n",
       "INSTNM                                                                      \n",
       "Spa Tech Institute-Ipswich                       NaN           0.0   37.0   \n",
       "Spa Tech Institute-Plymouth                      NaN           0.0  153.0   \n",
       "Spa Tech Institute-Westboro                      NaN           0.0   90.0   \n",
       "...                                              ...           ...    ...   \n",
       "Stylemaster College of Hair Design               NaN           0.0   77.0   \n",
       "Styles and Profiles Beauty College               NaN           0.0   31.0   \n",
       "Styletrends Barber and Hairstyling Academy       NaN           0.0   45.0   \n",
       "\n",
       "                                                   ...          UGDS_2MOR  \\\n",
       "INSTNM                                             ...                      \n",
       "Spa Tech Institute-Ipswich                         ...              0.000   \n",
       "Spa Tech Institute-Plymouth                        ...              0.000   \n",
       "Spa Tech Institute-Westboro                        ...              0.000   \n",
       "...                                                ...                ...   \n",
       "Stylemaster College of Hair Design                 ...              0.013   \n",
       "Styles and Profiles Beauty College                 ...              0.000   \n",
       "Styletrends Barber and Hairstyling Academy         ...              0.000   \n",
       "\n",
       "                                            UGDS_NRA  UGDS_UNKN  PPTUG_EF  \\\n",
       "INSTNM                                                                      \n",
       "Spa Tech Institute-Ipswich                       0.0     0.0541    0.4054   \n",
       "Spa Tech Institute-Plymouth                      0.0     0.2484    0.3399   \n",
       "Spa Tech Institute-Westboro                      0.0     0.0222    0.5778   \n",
       "...                                              ...        ...       ...   \n",
       "Stylemaster College of Hair Design               0.0     0.0000    0.0000   \n",
       "Styles and Profiles Beauty College               0.0     0.0000    0.0000   \n",
       "Styletrends Barber and Hairstyling Academy       0.0     0.0000    0.5556   \n",
       "\n",
       "                                            CURROPER  PCTPELL  PCTFLOAN  \\\n",
       "INSTNM                                                                    \n",
       "Spa Tech Institute-Ipswich                         1   0.2656    0.3906   \n",
       "Spa Tech Institute-Plymouth                        1   0.3716    0.4266   \n",
       "Spa Tech Institute-Westboro                        1   0.3409    0.4545   \n",
       "...                                              ...      ...       ...   \n",
       "Stylemaster College of Hair Design                 1   0.8036    0.7024   \n",
       "Styles and Profiles Beauty College                 1   0.8182    0.7955   \n",
       "Styletrends Barber and Hairstyling Academy         0   1.0000    1.0000   \n",
       "\n",
       "                                            UG25ABV    MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                   \n",
       "Spa Tech Institute-Ipswich                   0.7907              21500   \n",
       "Spa Tech Institute-Plymouth                  0.6250              21500   \n",
       "Spa Tech Institute-Westboro                  0.6882              21500   \n",
       "...                                             ...                ...   \n",
       "Stylemaster College of Hair Design           0.4510              17000   \n",
       "Styles and Profiles Beauty College           0.2400  PrivacySuppressed   \n",
       "Styletrends Barber and Hairstyling Academy   0.3529  PrivacySuppressed   \n",
       "\n",
       "                                            GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                          \n",
       "Spa Tech Institute-Ipswich                                6333  \n",
       "Spa Tech Institute-Plymouth                               6333  \n",
       "Spa Tech Institute-Westboro                               6333  \n",
       "...                                                        ...  \n",
       "Stylemaster College of Hair Design                       13320  \n",
       "Styles and Profiles Beauty College           PrivacySuppressed  \n",
       "Styletrends Barber and Hairstyling Academy              9495.5  \n",
       "\n",
       "[201 rows x 26 columns]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc['Sp':'Su']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college = college.sort_index(ascending=False)\n",
    "college.index.is_monotonic_decreasing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Dyersburg State Community College</th>\n",
       "      <td>Dyersburg</td>\n",
       "      <td>TN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2001.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0185</td>\n",
       "      <td>0.0010</td>\n",
       "      <td>0.0085</td>\n",
       "      <td>0.4423</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4921</td>\n",
       "      <td>0.2493</td>\n",
       "      <td>0.3097</td>\n",
       "      <td>26800</td>\n",
       "      <td>7475</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Dutchess Community College</th>\n",
       "      <td>Poughkeepsie</td>\n",
       "      <td>NY</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6885.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0446</td>\n",
       "      <td>0.0129</td>\n",
       "      <td>0.0049</td>\n",
       "      <td>0.3312</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2464</td>\n",
       "      <td>0.1936</td>\n",
       "      <td>0.1806</td>\n",
       "      <td>32500</td>\n",
       "      <td>10250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Dutchess BOCES-Practical Nursing Program</th>\n",
       "      <td>Poughkeepsie</td>\n",
       "      <td>NY</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>155.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0581</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.7548</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5294</td>\n",
       "      <td>0.6275</td>\n",
       "      <td>0.5430</td>\n",
       "      <td>36500</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BJ's Beauty &amp; Barber College</th>\n",
       "      <td>Auburn</td>\n",
       "      <td>WA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0714</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0714</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5192</td>\n",
       "      <td>0.6154</td>\n",
       "      <td>0.2917</td>\n",
       "      <td>NaN</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BIR Training Center</th>\n",
       "      <td>Chicago</td>\n",
       "      <td>IL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2132.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.1806</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6700</td>\n",
       "      <td>0.6998</td>\n",
       "      <td>0.6741</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>15394</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B M Spurr School of Practical Nursing</th>\n",
       "      <td>Glen Dale</td>\n",
       "      <td>WV</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4722</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.4444</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1411 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                         \n",
       "Dyersburg State Community College            Dyersburg     TN   0.0      0.0   \n",
       "Dutchess Community College                Poughkeepsie     NY   0.0      0.0   \n",
       "Dutchess BOCES-Practical Nursing Program  Poughkeepsie     NY   0.0      0.0   \n",
       "...                                                ...    ...   ...      ...   \n",
       "BJ's Beauty & Barber College                    Auburn     WA   0.0      0.0   \n",
       "BIR Training Center                            Chicago     IL   0.0      0.0   \n",
       "B M Spurr School of Practical Nursing        Glen Dale     WV   0.0      0.0   \n",
       "\n",
       "                                          WOMENONLY  RELAFFIL  SATVRMID  \\\n",
       "INSTNM                                                                    \n",
       "Dyersburg State Community College               0.0         0       NaN   \n",
       "Dutchess Community College                      0.0         0       NaN   \n",
       "Dutchess BOCES-Practical Nursing Program        0.0         0       NaN   \n",
       "...                                             ...       ...       ...   \n",
       "BJ's Beauty & Barber College                    0.0         0       NaN   \n",
       "BIR Training Center                             0.0         0       NaN   \n",
       "B M Spurr School of Practical Nursing           0.0         0       NaN   \n",
       "\n",
       "                                          SATMTMID  DISTANCEONLY    UGDS  \\\n",
       "INSTNM                                                                     \n",
       "Dyersburg State Community College              NaN           0.0  2001.0   \n",
       "Dutchess Community College                     NaN           0.0  6885.0   \n",
       "Dutchess BOCES-Practical Nursing Program       NaN           0.0   155.0   \n",
       "...                                            ...           ...     ...   \n",
       "BJ's Beauty & Barber College                   NaN           0.0    28.0   \n",
       "BIR Training Center                            NaN           0.0  2132.0   \n",
       "B M Spurr School of Practical Nursing          NaN           0.0    31.0   \n",
       "\n",
       "                                                 ...          UGDS_2MOR  \\\n",
       "INSTNM                                           ...                      \n",
       "Dyersburg State Community College                ...             0.0185   \n",
       "Dutchess Community College                       ...             0.0446   \n",
       "Dutchess BOCES-Practical Nursing Program         ...             0.0581   \n",
       "...                                              ...                ...   \n",
       "BJ's Beauty & Barber College                     ...             0.0714   \n",
       "BIR Training Center                              ...             0.0000   \n",
       "B M Spurr School of Practical Nursing            ...             0.0000   \n",
       "\n",
       "                                          UGDS_NRA  UGDS_UNKN  PPTUG_EF  \\\n",
       "INSTNM                                                                    \n",
       "Dyersburg State Community College           0.0010     0.0085    0.4423   \n",
       "Dutchess Community College                  0.0129     0.0049    0.3312   \n",
       "Dutchess BOCES-Practical Nursing Program    0.0000     0.0000    0.7548   \n",
       "...                                            ...        ...       ...   \n",
       "BJ's Beauty & Barber College                0.0000     0.0714    0.0000   \n",
       "BIR Training Center                         0.0000     0.0000    0.1806   \n",
       "B M Spurr School of Practical Nursing       0.0000     0.0000    0.0000   \n",
       "\n",
       "                                          CURROPER  PCTPELL  PCTFLOAN  \\\n",
       "INSTNM                                                                  \n",
       "Dyersburg State Community College                1   0.4921    0.2493   \n",
       "Dutchess Community College                       1   0.2464    0.1936   \n",
       "Dutchess BOCES-Practical Nursing Program         1   0.5294    0.6275   \n",
       "...                                            ...      ...       ...   \n",
       "BJ's Beauty & Barber College                     1   0.5192    0.6154   \n",
       "BIR Training Center                              0   0.6700    0.6998   \n",
       "B M Spurr School of Practical Nursing            1   0.4722    0.0000   \n",
       "\n",
       "                                          UG25ABV    MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                 \n",
       "Dyersburg State Community College          0.3097              26800   \n",
       "Dutchess Community College                 0.1806              32500   \n",
       "Dutchess BOCES-Practical Nursing Program   0.5430              36500   \n",
       "...                                           ...                ...   \n",
       "BJ's Beauty & Barber College               0.2917                NaN   \n",
       "BIR Training Center                        0.6741  PrivacySuppressed   \n",
       "B M Spurr School of Practical Nursing      0.4444  PrivacySuppressed   \n",
       "\n",
       "                                          GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                        \n",
       "Dyersburg State Community College                       7475  \n",
       "Dutchess Community College                             10250  \n",
       "Dutchess BOCES-Practical Nursing Program                9500  \n",
       "...                                                      ...  \n",
       "BJ's Beauty & Barber College               PrivacySuppressed  \n",
       "BIR Training Center                                    15394  \n",
       "B M Spurr School of Practical Nursing      PrivacySuppressed  \n",
       "\n",
       "[1411 rows x 26 columns]"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc['E':'B']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>...</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>INSTNM</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Dyersburg State Community College</th>\n",
       "      <td>Dyersburg</td>\n",
       "      <td>TN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2001.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0185</td>\n",
       "      <td>0.0010</td>\n",
       "      <td>0.0085</td>\n",
       "      <td>0.4423</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4921</td>\n",
       "      <td>0.2493</td>\n",
       "      <td>0.3097</td>\n",
       "      <td>26800</td>\n",
       "      <td>7475</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Dutchess Community College</th>\n",
       "      <td>Poughkeepsie</td>\n",
       "      <td>NY</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6885.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0446</td>\n",
       "      <td>0.0129</td>\n",
       "      <td>0.0049</td>\n",
       "      <td>0.3312</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2464</td>\n",
       "      <td>0.1936</td>\n",
       "      <td>0.1806</td>\n",
       "      <td>32500</td>\n",
       "      <td>10250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Dutchess BOCES-Practical Nursing Program</th>\n",
       "      <td>Poughkeepsie</td>\n",
       "      <td>NY</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>155.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0581</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.7548</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5294</td>\n",
       "      <td>0.6275</td>\n",
       "      <td>0.5430</td>\n",
       "      <td>36500</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BJ's Beauty &amp; Barber College</th>\n",
       "      <td>Auburn</td>\n",
       "      <td>WA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0714</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0714</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5192</td>\n",
       "      <td>0.6154</td>\n",
       "      <td>0.2917</td>\n",
       "      <td>NaN</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BIR Training Center</th>\n",
       "      <td>Chicago</td>\n",
       "      <td>IL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2132.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.1806</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6700</td>\n",
       "      <td>0.6998</td>\n",
       "      <td>0.6741</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>15394</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B M Spurr School of Practical Nursing</th>\n",
       "      <td>Glen Dale</td>\n",
       "      <td>WV</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4722</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.4444</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1411 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  CITY STABBR  HBCU  MENONLY  \\\n",
       "INSTNM                                                                         \n",
       "Dyersburg State Community College            Dyersburg     TN   0.0      0.0   \n",
       "Dutchess Community College                Poughkeepsie     NY   0.0      0.0   \n",
       "Dutchess BOCES-Practical Nursing Program  Poughkeepsie     NY   0.0      0.0   \n",
       "...                                                ...    ...   ...      ...   \n",
       "BJ's Beauty & Barber College                    Auburn     WA   0.0      0.0   \n",
       "BIR Training Center                            Chicago     IL   0.0      0.0   \n",
       "B M Spurr School of Practical Nursing        Glen Dale     WV   0.0      0.0   \n",
       "\n",
       "                                          WOMENONLY  RELAFFIL  SATVRMID  \\\n",
       "INSTNM                                                                    \n",
       "Dyersburg State Community College               0.0         0       NaN   \n",
       "Dutchess Community College                      0.0         0       NaN   \n",
       "Dutchess BOCES-Practical Nursing Program        0.0         0       NaN   \n",
       "...                                             ...       ...       ...   \n",
       "BJ's Beauty & Barber College                    0.0         0       NaN   \n",
       "BIR Training Center                             0.0         0       NaN   \n",
       "B M Spurr School of Practical Nursing           0.0         0       NaN   \n",
       "\n",
       "                                          SATMTMID  DISTANCEONLY    UGDS  \\\n",
       "INSTNM                                                                     \n",
       "Dyersburg State Community College              NaN           0.0  2001.0   \n",
       "Dutchess Community College                     NaN           0.0  6885.0   \n",
       "Dutchess BOCES-Practical Nursing Program       NaN           0.0   155.0   \n",
       "...                                            ...           ...     ...   \n",
       "BJ's Beauty & Barber College                   NaN           0.0    28.0   \n",
       "BIR Training Center                            NaN           0.0  2132.0   \n",
       "B M Spurr School of Practical Nursing          NaN           0.0    31.0   \n",
       "\n",
       "                                                 ...          UGDS_2MOR  \\\n",
       "INSTNM                                           ...                      \n",
       "Dyersburg State Community College                ...             0.0185   \n",
       "Dutchess Community College                       ...             0.0446   \n",
       "Dutchess BOCES-Practical Nursing Program         ...             0.0581   \n",
       "...                                              ...                ...   \n",
       "BJ's Beauty & Barber College                     ...             0.0714   \n",
       "BIR Training Center                              ...             0.0000   \n",
       "B M Spurr School of Practical Nursing            ...             0.0000   \n",
       "\n",
       "                                          UGDS_NRA  UGDS_UNKN  PPTUG_EF  \\\n",
       "INSTNM                                                                    \n",
       "Dyersburg State Community College           0.0010     0.0085    0.4423   \n",
       "Dutchess Community College                  0.0129     0.0049    0.3312   \n",
       "Dutchess BOCES-Practical Nursing Program    0.0000     0.0000    0.7548   \n",
       "...                                            ...        ...       ...   \n",
       "BJ's Beauty & Barber College                0.0000     0.0714    0.0000   \n",
       "BIR Training Center                         0.0000     0.0000    0.1806   \n",
       "B M Spurr School of Practical Nursing       0.0000     0.0000    0.0000   \n",
       "\n",
       "                                          CURROPER  PCTPELL  PCTFLOAN  \\\n",
       "INSTNM                                                                  \n",
       "Dyersburg State Community College                1   0.4921    0.2493   \n",
       "Dutchess Community College                       1   0.2464    0.1936   \n",
       "Dutchess BOCES-Practical Nursing Program         1   0.5294    0.6275   \n",
       "...                                            ...      ...       ...   \n",
       "BJ's Beauty & Barber College                     1   0.5192    0.6154   \n",
       "BIR Training Center                              0   0.6700    0.6998   \n",
       "B M Spurr School of Practical Nursing            1   0.4722    0.0000   \n",
       "\n",
       "                                          UG25ABV    MD_EARN_WNE_P10  \\\n",
       "INSTNM                                                                 \n",
       "Dyersburg State Community College          0.3097              26800   \n",
       "Dutchess Community College                 0.1806              32500   \n",
       "Dutchess BOCES-Practical Nursing Program   0.5430              36500   \n",
       "...                                           ...                ...   \n",
       "BJ's Beauty & Barber College               0.2917                NaN   \n",
       "BIR Training Center                        0.6741  PrivacySuppressed   \n",
       "B M Spurr School of Practical Nursing      0.4444  PrivacySuppressed   \n",
       "\n",
       "                                          GRAD_DEBT_MDN_SUPP  \n",
       "INSTNM                                                        \n",
       "Dyersburg State Community College                       7475  \n",
       "Dutchess Community College                             10250  \n",
       "Dutchess BOCES-Practical Nursing Program                9500  \n",
       "...                                                      ...  \n",
       "BJ's Beauty & Barber College               PrivacySuppressed  \n",
       "BIR Training Center                                    15394  \n",
       "B M Spurr School of Practical Nursing      PrivacySuppressed  \n",
       "\n",
       "[1411 rows x 26 columns]"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc['E':'B']"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
